﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _newup : System.Web.UI.Page
{
    public string nameid;   
    protected void Page_Load(object sender, EventArgs e)
    {
            nameid = htmlstr(Request.QueryString["nameid"]);
            //if (Session["nameid"] == null)
            //{
            //    nameid = Request.QueryString["id"];
            //}
            //else
            //{
            //    nameid = Session["nameid"].ToString();
            //}
            //Response.Write(nameid);
        ShowData();
    }

    private void ShowData()
    {
        try
			{
		DataSet ds = Socut.Data.ExecuteDataSet("select * from web_upfile where nameid<>'' and nameid='" + nameid + "' order by id desc");
        GrideView1.DataSource = ds;
        GrideView1.DataBind();
		}
		catch
			{
				Response.Write("您的操作有误，请重新操作！！");
                Response.End();
			}

    }
	
    /// <summary>
    /// 产生个随即名称

    /// </summary>
    /// <returns></returns>
    public string sjname() {

        string sj = null;
        sj = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.TimeOfDay.Hours.ToString() + DateTime.Now.TimeOfDay.Minutes.ToString() + DateTime.Now.TimeOfDay.Milliseconds.ToString();
        return sj;
    
    
    }
	
	    public string htmlstr(string chr)
    {
        if (chr == null)
            return "";
        chr = chr.Replace("<", "");
        chr = chr.Replace(">", "");
        chr = chr.Replace("\n", "");
        chr = chr.Replace("\"", "");
        chr = chr.Replace("'", "");
        chr = chr.Replace(" ", "");
        chr = chr.Replace("select", "");
        chr = chr.Replace("delete", "");
        chr = chr.Replace("update", "");
        chr = chr.Replace("drop", "");
        chr = chr.Replace(";", "");
        chr = chr.Replace("(", "");
        chr = chr.Replace(")", "");
        chr = chr.Replace("and", "");
        chr = chr.Replace("or", "");
        chr = chr.Replace("\r", "");
        return (chr);
    }
}
